package cn.lut.crowd.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @user:dell
 * @date:2021年01月08 12:30
 */
@Configuration
public class CrowdWebMvcConfig implements WebMvcConfigurer {
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        String urlPath="auth/member/to/reg/page.html";
//        目标视图的名称,将来拼接前后缀，前缀：classpath:/templates/，后缀.html
        String viewName="member-reg";
//        添加一个viewController
        registry.addViewController(urlPath).setViewName(viewName);
        registry.addViewController("/auth/member/to/login/page.html").setViewName("member-login");
        registry.addViewController("/auth/member/to/center/page").setViewName("member-center");
        registry.addViewController("/member/my/crowd").setViewName("member-crowd");
        // view-controller 是在 project-consumer 内部定义的，所以这里是一个不经过 Zuul 访问的地址，所以这个路径前面不加路由规则中定义的前缀：“/project”
         registry.addViewController("/agree/protocol/page").setViewName("project-agree");
         registry.addViewController("/launch/project/page").setViewName("project-launch");
    }
}
